package com.wangrui.consumer.controller;

import com.wangrui.consumer.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    private OrderService orderService;
    @Autowired
    public OrderController(OrderService orderService) {
        this.orderService = orderService;
    }
    @GetMapping("/addOrder")
    public String addOrder(Long productId, Integer num) {
        orderService.addOrder(productId,num);
        return "success";
    }
}
